package com.rpc.client.controller;

import com.rpc.client.rpc.RpcClient;
import com.rpc.client.service.CalcService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.io.IOException;

@RequestMapping("/calc")
@RestController
public class CalcController{

    @RequestMapping("/add")
    public int add(int a, int b) throws IOException {
        RpcClient rpcClient = new RpcClient();
        return rpcClient.refer(CalcService.class, "192.168.128.228", 1234).add(a,b);

    }
}
